package com.learning.sims.status;

import android.util.Log;

import com.learning.sims.people.People;
import com.learning.sims.utils.SimsUtil;

/**
 * Created by xie on 2017/4/22.
 */

public class SleepStatus implements IStatus {

    @Override
    public void doSomething(long time, People people) {
        if(SimsUtil.isSleepTime(time)){
            people.setEnergy(people.getEnergy() - people.getSleepSpendEnergyRate());
            Log.d("Sims","Sleeping = "+people.getEnergy());
        }else{
            if(people.isNeedAddEnergy()){
                people.setStatus(Status.GotoEat);
            }else{
                people.setStatus(Status.GotoMining);
            }
        }
    }

}
